package io.renren.modules.member.controller;

import io.renren.common.utils.PageUtils;
import io.renren.common.utils.R;
import io.renren.modules.member.service.ExamMiddleHistoryService;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

/**
 * 长跑历史
 *
 * @author Mark 军事体育训练考核系统
 */
@RestController
//@Controller
@RequestMapping("exam/middle")
public class ExamMiddleHistoryController {

    private final Logger logger = LoggerFactory.getLogger(ExamMiddleHistoryController.class);

    @Autowired
    private ExamMiddleHistoryService historyService;

    /**
     * 列表
     */
    @RequestMapping("/list")
    @RequiresPermissions("exam:exam:list")
    public R list(@RequestParam Map<String, Object> params){
        PageUtils page = historyService.queryPage(params);

        return R.ok().put("page", page);
    }

    /**
     * 按条件查询最新成绩
     */
    @RequestMapping("/findAllLast")
    public R findAllLast(@RequestParam Map<String, Object> params) {
        return R.ok().put("data", historyService.findAllLast(params));
    }

//    /**
//     * 列表
//     */
//    @RequestMapping("exam/middle/show")
//    public String show(){
//        return "redirect:showMiddle.html";
//    }
}
